package com.wzh.example.demo;

import com.wzh.example.demo.repository.mapper.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author zh wang
 * @Create 2025/4/14 19:09
 */
@Service
public class DemoService2 {
    @Autowired
    private UserRepository userRepository;
    public void testTransaction2() {
        System.out.println("修改 22 开始");
        userRepository.updateEmail("张三", "222");
        System.out.println("修改 22 结束");
        throw new RuntimeException("测试事务");
    }
}
